<?php

$env = require VDIR . '/env.php';
$params = require __DIR__ . '/params.php';
$config = [
    'id' => 'basic-console',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'app\commands',
    'components' => [
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'logFile' => '/home/wwwlogs/php/zb.ichengxi.cn/php.log',
                    'levels' => ['error', 'warning', 'info'],
                    'logVars' => [],
                    'exportInterval' => 0,
                ],
            ],
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
            ],
        ],
        'db' => [
            'dsn' => 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME,
            'username' => DB_USER,
            'password' => DB_PWD,
            'class' => 'yii\db\Connection',
            'emulatePrepare' => true,
            'charset' => 'utf8mb4',
            'enableSchemaCache' => true,
            'schemaCacheDuration' => 86400,
        ],
        'redis' => [
            'class' => 'BaseComponents\base\RedisConn',
            'hostname' => REDIS_HOST,
            'port' => REDIS_PORT,
        ],
        'curl' => [
            'class' => 'yii\curl\Curl'
        ]
    ],
    'params' => $params,
];

return $config;